Ext.define('DutyList.calendar.dd.DragZonUserToCalendarPanel',{
    extend: 'Ext.dd.DragZone',
    require: [
        'Ext.selection.Model'
    ],
    constructor: function(el, config) {
        if (!DutyList.calendar._statusProxyInstanceDragUser) {
            DutyList.calendar._statusProxyInstanceDragUser = new DutyList.calendar.dd.StatusProxy();
        }
        this.proxy = DutyList.calendar._statusProxyInstanceDragUser;
        this.callParent(arguments);
    },
    getDragData: function(e) {
        var el = this.view.getSelectionModel().getLastSelected();
        return {
            rec: el,
            proxy: this.proxy
        };
    } ,
    onInitDrag: function(x, y) {
        if (this.dragData.ddel) {
            var ghost = this.dragData.ddel.cloneNode(true),
                child = Ext.fly(ghost).down('dl');
            Ext.fly(ghost).setWidth('auto');
            if (child) {
                // for IE/Opera
                child.setHeight('auto');
            }
            this.proxy.update(ghost);
            this.onStartDrag(x, y);
        }
        this.view.onInitDrag();
        return true;
    },
    afterRepair: function() {
        //Ext.fly(this.dragData.).highlight(this.hlColor || 'c3daf9');
        this.dragging = false;
    },
    getRepairXY: function(e) {
        if (this.dragData.ddel) {
            return Ext.fly(this.dragData.ddel).getXY();
        }
    },

    afterInvalidDrop: function(e, id) {
        Ext.select('.ext-dd-shim').hide();
    }

});